//
//  HeartType.swift
//  DaRings
//
//  Created by 尹琼 on 2023/2/17.
//

import UIKit
import Charts
import MYModule

public enum HeartType {
    case day
    case week
    case month
}

public extension HeartType {
    
    func xValueFormatter(date: Date) -> IAxisValueFormatter {
        
        switch self {
        case .day:
            let formatter = DayAxisValueFormatter()
            return formatter
        case .week:
            let formatter = WeekAxisValueFormatter()
       
            return formatter
        case .month:
            let formatter = MonthAxisValueFormatter(date: date)
            return formatter
        }
        
    }
    
    
    func barCount(date: Date) -> Int {
      
        switch self {
        case .day:
            return 48
        case .week:
            return 7
        case .month:
            return date.monthDays
        }
        
    }
    
}
